package com.ddxz.elastic.controller;

import com.dangdang.ddframe.job.lite.api.JobScheduler;
import com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2021/2/24
 */

@RestController
public class ElasticController {
    @RequestMapping(value = "/start", method = RequestMethod.GET)
    public Object start() {
        // 启动定时任务
        scheduler.init();
        return "OK";
    }

    @Autowired
    private JobScheduler scheduler;
}
